#include <stdlib.h>
#include "LexiconIter.h"
#include "../types/Pair.h"

LexiconIter* lexicon_iter_new(Lexicon* lexicon)
{
  return (LexiconIter*)lexicon->tokens;
}

void lexicon_iter_free(LexiconIter* iter)
{
}

LexiconIter* lexicon_iter_prev(LexiconIter* iter)
{
  return iter->prev;
}

LexiconIter* lexicon_iter_next(LexiconIter* iter)
{
  return iter->next;
}

const char* lexicon_iter_get_name(LexiconIter* iter)
{
  Pair* pair = (Pair*)iter->data;
  return (const char*)pair->one;
}

Regex* lexicon_iter_get_regex(LexiconIter* iter)
{
  Pair* pair = (Pair*)iter->data;
  return (Regex*)pair->two;
}
